package example.data;

import java.util.Collections;
import java.util.Vector;

/**
 * Created by lenovo on 2016/11/7 0007.
 * 用 Vector 类的 v.add() 方法及 Collection 类的 collections.max() 来获取向量的最大元素
 */
public class VectorData {
    public static void main(String[] args) {
        Vector<Double> v = new Vector<Double>();
        v.add(new Double("3.4324"));
        v.add(new Double("3.3532"));
        v.add(new Double("3.342"));
        v.add(new Double("3.349"));
        v.add(new Double("2.3"));
        Object obj = Collections.max(v);
        System.out.println("最大元素是：" + obj);
    }
}
